//
//  UIButtonView.m
//  彩票
//
//  Created by apple on 15/9/22.
//  Copyright (c) 2015年 李明. All rights reserved.
//

#import "UIButtonView.h"
#define ImageW 30
@implementation UIButtonView


- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self) {
        self.imageView.contentMode = UIViewContentModeCenter;
    }
    return self;
}


- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
    CGFloat x = 0;
    CGFloat y = 0;
    CGFloat w = contentRect.size.width - ImageW;
    CGFloat h = contentRect.size.height;
    return CGRectMake(x, y, w, h);
}


- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    CGFloat w = ImageW;
    CGFloat h = contentRect.size.height;
    CGFloat x = contentRect.size.width - ImageW;
    CGFloat y = 0;
    return CGRectMake(x, y, w, h);
}
@end
